home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
326-350
/
disk_342
/
sksh
/
addendum1.3.doc
< prev
next >
Wrap
Text File
|
1992-05-06
|
22KB
|
661 lines
Addendum for Version 1.3
SKsh
A ksh-like Shell for the Amiga
Version 1.4
(Copyright) 1989, 1990
Steve Koren
March 19, 1990
Addendum to Version 1.3
This document describes additions and changes to SKsh since
version 1.2.
Hidden Bit Support
The 'ls' command now omits files from the directory listing
if they have the 'hidden' (h) bit set. To see hidden
files, use the 'h' option to the ls command.
cd bug fixed
SKsh will now report an error if the destination of a 'cd'
command is a file.
touch bug fixed
Touching an empty directory will no longer convert it to a
file.
extname command added
An 'extname' command was added which complements the
'dirname' and 'basename' commands. It will print either
the extension of a filename, or the portion of the file
name which is not the extension (when given the 'v'
option). For example, 'extname foo.bar' would print 'bar',
while 'extname -v foo.bar' would print 'foo'. extname can
also print the part of the file name which is not the
extension, if given the -v option.
Spaces now passed correctly to external commands
SKsh now passes arguments with spaces correctly to external
commands (by surrounding them with double quotes). It
should have been doing this all along.
window command added
An external command has been added which can be used to
move the window, resize the window, change the window
title, move the window to the back or front, report the
current window position, report the current window size,
report the current window title, report the screen size, or
report the mouse position relative to the window or screen.
See the documentation on the 'window' command for details.
SKSH Amiga Shell Page 2 Addendum to 1.3
Overstrike mode for command line editing
There is now an overstrike mode for command line editing.
The mode can be toggled between insert and overstrike by
using the '^z' key. Also, two new options flags support
overstrike mode. If the 'O' options is set, overstrike
becomes the default instead of insert. If the '1' flag is
set, the mode is changed back to the current default upon
return; otherwise it remains as is.
There is currently a small bug with overstrike mode that
causes it to print a character in the wrong position if
characters are typed when the left most section of a long
line is displayed and the cursor is at the right edge of
the window. If this occurs, you can use '^l' to correct
the situation. I didn't think this was serious enough to
warrant spending a lot of time hunting it down, since it is
a corner case. I will probably fix it later.
New command line editing functions
The '^g' key has now been mapped to abort the current
command line. This is easier to type than the two
character dipthong '^a^k'.
The sequence esc-/ has been mapped to insert the 'tail' of
the previous command line; that is, all of the previous
line except the first word. It is similar in operation to
the esc-. command.
Both esc-. and esc-/ now insert a space if there was not
one there already, and if they are not invoked at the
beginning of the line.
which -s bug fixed
A minor bug with the 'which -s' command was causing it to
print a newline instead of exitting silently if the command
was not found. This has been fixed.
info command extended
The 'info' command now reports the number of free kilobytes
on the device as well as the number of used kilobytes.
touch, cp -c now reset archive bit
The 'touch' and 'cp -c' commands now reset the AmigaDos
archive bit.
SKSH Amiga Shell Page 3 Addendum to 1.3
Error report bug fixed
There was a bug in the previous error reporting routine
which caused a buffer overflow error if a long error
message was encountered (such as would be the case for a
very long file name which was not found). This has been
fixed. Error messages can now be much longer, and they are
truncated to a manageable length.
-a (all) option added to info
A '-a' flag was added to the info command which reports
information on all filesystem volumes. Unmounted
filesystems are silently skipped.
-b (builtin) option added to unset
It is now possible to unset builtin commands as well as
aliases, functions, and variables. This makes it easier
for people who wish to use an external command instead of
the SKsh builtin version. The memory taken by the code is
not actually freed, but after a builtin is unset, it is no
longer possible to use that builtin short of restarting
SKsh. Note that this is a dangerous thing to do; you can
inadvertently unset a builtin such as 'shift' or 'exit'
which is need for proper operation of the shell. In fact,
you can even unset the 'unset' builtin itself, although I
wouldn't recommend doing this. Only use this command if
you are sure you know what you are doing.
The other unset commands have aliases such as 'unalias' to
make them easier to type and remember; this one comes with
no such alias.
A future version of SKsh ("tiny-SKsh") will be provided
which only contains a few of the necessary builtins, and
eliminates the rest to save space.
join command added
A new "join" command has been added which allows textual or
binary data to be concatenated and the results sent to
another file. See the documentation on that command for
details.
SKSH Amiga Shell Page 4 Addendum to 1.3
Unmounted volumes in path no longer searched
If your SKsh path includes unmounted volumes, the disk
requester will no longer appear. The unmounted volumes are
ignored. This allows you to, for example, include df0:c in
your path without having a disk in df0:. In addition, the
cd command no longer causes the disk requester to appear if
the destination directory is on an unmounted volume. This
behavior is changeable with the 'U' option, which is
described below.
chmod with - option no longer sets rewd bits
In SKsh 1.2, a chmod command which reset any of the high
four bits also set the low four bits, even if they were not
set to begin with. This has been fixed.
wc bug on large files fixed
There was a bug in version 5.02 of the Lattice compiler
which caused wc to report improper character and word
counts for very large files. wc is now compiled with
version 5.04 of the compiler, and this bug is fixed.
wc no longer truncates file names
If wc is passed file names longer than 16 characters, they
will no longer be truncated.
cat now reads standard input properly
The cat command now properly reads standard input if
redirected from a file or a pipeline.
External commands now optimized
The external commands are now optimized, reducing their
size slightly and, at least in theory, making them faster.
History list length limit removed
In versions 1.2 and earlier, there was an arbitrary limit
of 256 lines in the history list at one time. Since this
limit was completely arbitrary, it has been extended to
32000 lines. The list length is controlled by the HISTSIZE
variable; memory usage can be reduced by making this
variable a small number.
SKSH Amiga Shell Page 5 Addendum to 1.3
History searches now can examine only line prefix
History searches previously would match text occurring any
place within a line. Some people prefer a search which
matches only a line prefix; this has been added as an
option. The default is the original method; however,
setting the 'P' option forces history searches to match a
line prefix.
'x' added as an synonym for 'e' in chmod command
An 'x' can now be used as a synonym for 'e' in the chmod
command, making this command operate more like its Un*x
equivalent.
getenv bug fixed
SKsh has been recompiled with a latter version of the
Lattice compiler which fixes the getenv problem. getenv
now works properly, and it is no longer necessary to use
the AmigaDos getenv call.
Case insensitive file name expansion, wildcards, etc.
There is now an option to make command line file name
expansion, wildcard card file expansion, and a few other
things case insensitive. If the 'c' option to SKsh is set,
all wildcard expansions will be case insensitive. This
applies also to commands such as 'aliases', 'functions',
'set', and 'match'. Anything that previously accepted a
wildcard pattern will now be case insensitive if the 'c'
flag is set. This flag is set for you in the new .skshinit
file, which should be installed in place of the old one.
Wildcard pattern matching changed
The wildcard expansion routines have been changed slightly
to better conform to the Un*x behavior. If a pattern does
not match any files, the pattern itself is returned. For
example, 'echo blah*' does in fact echo 'blah*' if the
pattern matches no files. This will cause most commands
which deal with files to return an error message.
ls now reports an error upon file not found
The ls command now reports an error message if any of the
files specified on the command line are not found.
SKSH Amiga Shell Page 6 Addendum to 1.3
tail error reporting bug fixed
A minor bug in the tail command has been fixed. The error
message printed if a file couldn't be found was missing a
trailing newline; this has been added.
mkdir bug fixed
mkdir no longer changes files to directories if the file
existed previously. This was actually a bug in the Lattice
mkdir() function, which was not reporting an error code if
a file with the same name as the new directory existed.
'*' in filename bug fixed
A file with a '*' or '?' in the filename will no longer
crash the shell if it is listed explicitly or matched with
a pattern. Previously, the pattern matching code was
calling itself recursively and infinitely in this case. It
no longer does this.
expr bug fixed
'expr 1 / 0' no longer crashes SKsh. It now gives a result
of zero.
-m added to test expressions
A -m switch was added to test expressions which allows a
device to be tested to see whether it contains a mounted
disk. For example, 'c:' will be "mounted" if it points to
a real location on a physical disk, and "df1:" will be
mounted if it contains a floppy disk. The -m switch will
return true if given a null argument (""). Also, it can be
passed a device and path name, in which case the path
portion will be ignored. This feature is often convenient
in scripts.
-ot, -nt added to test expressions
Two new tests were added which determine whether a given
file is older than or newer than another. If the files are
the same age (perhaps because they are the same file),
false is returned for either test.
SKSH Amiga Shell Page 7 Addendum to 1.3
U option added
A new 'U' option was added which, if set, will cause a
requester to appear when SKsh sees an unmounted volume in
the path. This flag is normally reset.
Infinite recursion no longer prints *** break
Previously, if SKsh caught what it believed to be infinite
recursion in a function or alias, it would print "***
break" to the console. This no longer happens; the break
message is printed only if ^c is used to interrupt a
pending operation.
Function key bug fixed
With the 'h' option set, lines that are entered with the
function keys can now be edited.
chmod now continues after error
If chmod is unable to change the permissions on a file, it
now continues and attempts to process the rest of the files
in the argument list. It previously stopped after the
first error was encountered.
File name completion extended
In addition to being optionally non case sensitive, file
name completion now works in the middle of a line. That
is, the cursor no longer has to be at the end of line.
This feature works with <tab> (esc-esc), <esc>*, and <esc>=
style completion mechanisms. The new text will be inserted
into the proper place in the command line.
rm -r bug fixed
In SKsh 1.2, an rm -r on a nonexistant file rather rudely
crashed the system. This no longer happens, and a sensible
error message is printed instead.
return bug fixed
The return statement now operates correctly in scripts.
Previously, it only worked in functions, but had no effect
when used in a script.
SKSH Amiga Shell Page 8 Addendum to 1.3
Documentation updates
As always, I have tried to keep the UserMan and Reference
documents up to date with the lattest changes and
additions. Also, a new ErrorCodes.doc file is included
which lists each SKsh error code.
New Files
A new file, called "Stuff.sksh" has been included. This
file contains some useful functions and aliases. It is not
by default loaded by SKsh; it is intended to be a source of
functions which can be cut out and placed into a .skshrc
file. Alternatively, if all the functions and aliases of
the Stuff.sksh file are desired, it can be copied to the
sksh: directory and sourced from the .skshrc file with the
following line:
. sksh:Stuff.sksh
The Stuff.sksh file currently contains a "man" function for
accessing online manual pages, a "qrm" function to query
before deleting files, "pushd", "popd", and "cleard"
commands to implement a directory stack, and a few other
things as well. The file may grow in future versions of
Sksh. Comments in the file explain the operation of each
command.
Notes
There are a few things that may appear to be SKsh bugs, but in
reality are AmigaDos problems:
* Append redirection does not work with external binaries.
This is NOT an SKsh bug; the Amiga uses two distinct
methods of file I/O which do not coexist well. SKsh uses
one method which is standard among compilers and operating
systems; however certain things on the Amiga must be done
with the other method, and problems arise as a result. It
would be *possible* to fix this problem in SKsh, but as a
matter of principle I won't do it. It is really a DOS
architecture problem, and shouldn't need to be fixed in
application programs.
* The SKsh file I/O is slower than it should be. This is,
again, caused by the two disjoint file I/O methods; the
standard mechanisms are much slower than the other method.
This could also be fixed in SKsh, but again as a matter of
principle I won't.
SKSH Amiga Shell Page 9 Addendum to 1.3
* Resetting the 'w' bit on a file, and then "cat"ing another
file to that one will overwrite the first file, even though
the 'w' bit is not set. This is, again, an AmigaDos
problem; the fopen() call succeeds when it should fail.
Applications should not have to check this flag on each
fopen. Hopefully this will be fixed in a future version of
AmigaDos. There are similar problems with the 'r' flag.
That said, I should point out that even though AmigaDos has
certain bugs and architectural problems, it is nonetheless one
of the best PC operating systems; it provides many features such
as shared libraries, multitasking, and multiple screens which
other micro operating systems do not yet have. Commodore is
also steadily improving the OS, fixing bugs, and adding new
features.
There are a few other things to note:
* SKsh needs the latest version of ARP installed. If an
early ARP is used, there could be problems invoking certain
programs. If you have these problems, check your version
of ARP and obtain a more recent one if necessary.
* Since SKsh uses its own notion of a PATH, certain programs
may still look at the AmigaDos path, and hence require that
to be set. This is OK; the two path mechanisms will not
interfere with each other.
As a final note, I would like to thank everyone who made
suggestions and reported bugs. These people are too numerious
to mention individually, but nonetheless have contributed to
SKsh in an important way. Many of the improvements in SKsh 1.3
came directly from user suggestions.
SKSH Amiga Shell Page 10 Addendum to 1.3